﻿@model TuanAnhPersonalWeb.Models.ProjectModel

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
  
        <table>
        
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.PROJECT_NAME)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PROJECT_NAME)
            @Html.ValidationMessageFor(model => model.PROJECT_NAME)
        </div>
        <td>
           <div class="editor-label">
            @Html.LabelFor(model => model.PTYPE)
        </div>
         <div class="editor-field">
          @Html.DropDownListFor(model => model.PTYPE, ViewData["Type"] as SelectList,"Chọn Loại Project", new { style = "width:160px", id="Album_" })
           @Html.ValidationMessageFor(model => model.PTYPE)
        </div>
        </td>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.LOCATION)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LOCATION)
            @Html.ValidationMessageFor(model => model.LOCATION)
        </div>
        </td>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.INVERSTER)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.INVERSTER)
            @Html.ValidationMessageFor(model => model.INVERSTER)
        </div>
        </td>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.OTHER)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.OTHER)
            @Html.ValidationMessageFor(model => model.OTHER)
        </div>
        </td>
        </tr>
        <tr>
        <td colspan="3">
        <div class="editor-label">
            @Html.LabelFor(model => model.PROJECT_CONTENT)
        </div>
        <div class="editor-field">
             @Html.TextAreaFor(model => model.PROJECT_CONTENT, new { id = "ckeditor", @class = "ckeditor" })
            @Html.ValidationMessageFor(model => model.PROJECT_CONTENT)
        </div>
        </td>
        </tr>
       <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.IMAGE_DIR)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.IMAGE_DIR, new { id = "imgdir", @readonly = "true" })
            @Html.ValidationMessageFor(model => model.IMAGE_DIR)
        </div>
        </td>

        <td style="width:100%"> 
         <script type="text/javascript">
             var finder = new CKFinder();
             finder.selectActionFunction = ShowFileInfo;
             finder.basePath = '/ckfinder/';
             finder.create();
             config.defaultDisplayFilename = true;
             function ShowFileInfo(fileUrl, data) {
                 //var imgdir = document.getElementById("imgdir").value;
                 document.getElementById("imgdir").value = fileUrl;
                 var str = fileUrl.toString();
                 alert('Add Link Successfully. Please enter description on the left hand side of the screen!.');
             }
                
</script>
</td>
        
        </tr>

  </table>

        <p>
            <input type="submit" value="Create" />
        </p>
 
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
